package com.fqgj.sentry.policy.client;

import com.fqgj.sentry.policy.entity.PcExecuteResultEntity;
import com.fqgj.sentry.policy.enums.ExecutorDefaultResultEnum;

import java.util.List;

/**
 * Created by ykpbean kangping.ying@yuntu-inc.com
 *
 * @description
 * @create 2017-07-31 下午8:29
 */


public interface ExecuteResultService {
    /**
     * 添加策略的执行结果
     *
     * @param executeResultEntity
     * @return
     */
    Long insertExecuteResult(PcExecuteResultEntity executeResultEntity);

    /**
     * 根据 策略id查询该策略集下的执行结果集
     *
     * @param policySetsId
     * @return
     */
    List<PcExecuteResultEntity> selectExecuteResultList(Long policySetsId);

    /**
     * 根据优先级 查询执行结果
     *
     * @param policySetsId
     * @param executorResultEnum
     * @return
     */
    PcExecuteResultEntity selectExecuteResultListByResult(Long policySetsId, ExecutorDefaultResultEnum executorResultEnum);

    /**
     * 根据优先级 查询执行结果
     *
     * @param policySetsId
     * @return
     */
    PcExecuteResultEntity selectMaxLevelExecuteResult(Long policySetsId);

    /**
     * 根据id删除某个执行结果
     *
     * @param id
     * @return
     */
    Boolean deleteExecuteResult(Long id);

    /**
     * 更新结果集
     *
     * @param executeResultEntity
     * @return
     */
    Boolean updateExecuteResult(PcExecuteResultEntity executeResultEntity);

    /**
     * 查询结果集
     *
     * @param resultId
     * @return
     */
    PcExecuteResultEntity findByExecutorResultId(Long resultId);
}
